/**
 * 
 */
package DCAnalyzer;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author sambeek
 *
 */
public class DCStats {
	@SuppressWarnings("unused")
	private int contributor = 0, coverage = 0, creator = 0, date = 0,
	description = 0, format = 0, identifier = 0, language = 0, publisher = 0, relation = 0,
	rights = 0, source = 0, subject = 0, title = 0, type = 0;
	
	@SuppressWarnings("unused")
	private int total_items = 0;
	
	@SuppressWarnings("unused")
	private int title_0 = 0, title_1 = 0, title_2 = 0, title_3 = 0, title_4 = 0;
	
	public DCStats(List<DCElement> dCElementList) {
		

		
		Iterator<DCElement> it = dCElementList.iterator();
	
		DCElement next = null;

		while (it.hasNext()) {
			next = it.next();
			
			contributor += next.getContributor().size();
			coverage += next.getCoverage().size();
			creator += next.getCreator().size();
			date += next.getDate().size();
			description += next.getDescription().size();
			format += next.getFormat().size();
			identifier += next.getIdentifier().size();
			language += next.getLanguage().size();
			publisher += next.getPublisher().size();
			relation += next.getRelation().size();
			rights += next.getRights().size();
			source += next.getSource().size();
			subject += next.getSubject().size();
			
			int title_size = next.getTitle().size();
			title += title_size;
				if(title_size == 0){
					title_0++;
				}else if(title_size == 1){
					title_1++;
				}else if(title_size == 2){
					title_2++;
				}else if(title_size == 3){
					title_3++;
				}else{
					title_4++;
				}
			type += next.getContributor().size();
			
			total_items++;								
		}
		
		System.out.println(
				"Total items: "+total_items+"\n"+
				"Items with 0 titles: "+title_0+"\n"+
				"Items with 1 titles: "+title_1+"\n"+
				"Items with 2 titles: "+title_2+"\n"+
				"Items with 3 titles: "+title_3+"\n"+
				"Items with 4 titles: "+title_4+"\n"
				);
			
			
	}

}
